﻿
using System;
using agsXMPP.protocol.client;
using sharpxbot.Core.Connection;
namespace sharpxbot.Core.Messaging
{
    /// <summary>
    /// Represents thread-safe channel over xmpp connection
    /// </summary>
    public class XmppChannel : SharedChannel
    {
        public XmppChannel(IConnection connection)
        {
            if (connection == null)
                throw new NullReferenceException("Null reference connection passed to contructor");

            this.connection = connection;
        }

        protected override void SendMessageImpl(Message msg)
        {
            connection.Send(msg.ToString());
        }

        private IConnection connection;
    }
}
